# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LabelLock do
  @moduledoc """
  A Lock that can be applied to a Label, Field, or Choice.

  ## Attributes

  *   `capabilities` (*type:* `GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LabelLockCapabilities.t`, *default:* `nil`) - Output only. The user's capabilities on this LabelLock.
  *   `choiceId` (*type:* `String.t`, *default:* `nil`) - The ID of the Selection Field Choice that should be locked. If present, `field_id` must also be present.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time this LabelLock was created.
  *   `creator` (*type:* `GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2UserInfo.t`, *default:* `nil`) - Output only. The user whose credentials were used to create the LabelLock. This will not be present if no user was responsible for creating the LabelLock.
  *   `deleteTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. A timestamp indicating when this LabelLock was scheduled for deletion. This will be present only if this LabelLock is in the DELETING state.
  *   `fieldId` (*type:* `String.t`, *default:* `nil`) - The ID of the Field that should be locked. Empty if the whole Label should be locked.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Resource name of this LabelLock.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. This LabelLock's state.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :capabilities =>
            GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LabelLockCapabilities.t() | nil,
          :choiceId => String.t() | nil,
          :createTime => DateTime.t() | nil,
          :creator => GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2UserInfo.t() | nil,
          :deleteTime => DateTime.t() | nil,
          :fieldId => String.t() | nil,
          :name => String.t() | nil,
          :state => String.t() | nil
        }

  field(:capabilities,
    as: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LabelLockCapabilities
  )

  field(:choiceId)
  field(:createTime, as: DateTime)
  field(:creator, as: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2UserInfo)
  field(:deleteTime, as: DateTime)
  field(:fieldId)
  field(:name)
  field(:state)
end

defimpl Poison.Decoder, for: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LabelLock do
  def decode(value, options) do
    GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LabelLock.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DriveLabels.V2.Model.GoogleAppsDriveLabelsV2LabelLock do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
